<!-- File: /app/View/Videos/view.ctp -->

<h1>Game Play</h1>

<?php 
                        if($isLoged)
                            {
                                echo '<p><div class="boton"><div class="boton_content">';
                                echo $this->Html->link('Adicionar Game Play', array('action' => 'add'));
                                echo '</div></div></p>';
                            }
?>
<table>
    
<!-- Aqui é onde nós percorremos nossa matriz $posts, imprimindo
as informações dos posts -->
	
	<div id="post_background">
		<?php foreach ($aux as $video): ?>
			<div class="text">			
				<h2><?php echo $video['Video']['title']?></h2>
                                <div class="art">
                                <iframe width="530" height="300" src="<?php echo $video['Video']['url']?>" frameborder="0" allowfullscreen></iframe>
                                </div>
				<p>
				
				<?php
				if ($isLoged){
					if(($video['Video']['user_id'] == $userId) or $isAdmin=="admin"){
							
							echo $this->Html->link($this->Html->image('icons/ico/modify.ico',
                                                        array("alt" => __('Edit'), "title" => __('Edit'),"width" => __('15'))),
                                                        array('action' => 'edit', $video['Video']['id']),
                                                        array('escape' => false));
                                        
							
		
							echo $this->Form->postLink($this->Html->image('icons/ico/delete.ico',
                                                        array("alt" => __('Delete'), "title" => __('Delete'),"width" => __('15'))), 
                                                        array('action' => 'delete', $video['Video']['id']),
                                                        array('escape' => false),
							__('Você tem certeza?'));
								
					}
				}
				?>
                                <?php echo $video['Video']['created']; ?>
                                </p>
			</div>
		<?php endforeach; ?>
	</div>

</table>